package org.jks.model;

import java.util.Date;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.GenericGenerator;

import com.google.gson.annotations.Expose;

@Entity
@Table(name = "MsgTask")
public class MsgTask {
	@Id
	@GeneratedValue(generator = "increment")
	@GenericGenerator(name = "increment", strategy = "increment")
	@Expose
	private long Id;
	@Column(length = 1024, nullable = false)
	@Expose
	private String NotifyContent;
	@Temporal(TemporalType.TIMESTAMP)
	@Expose
	private Date NotifyTime;
	@Expose
	private long NotifyTimes;
	@OneToMany(mappedBy = "MsgTask", fetch = FetchType.LAZY, cascade = { CascadeType.ALL }, orphanRemoval = true)
	@Expose
	private List<Msg> Msgs;

	public long getId() {
		return Id;
	}

	public void setId(long id) {
		Id = id;
	}

	public String getNotifyContent() {
		return NotifyContent;
	}

	public void setNotifyContent(String notifyContent) {
		NotifyContent = notifyContent;
	}

	public Date getNotifyTime() {
		return NotifyTime;
	}

	public void setNotifyTime(Date notifyTime) {
		NotifyTime = notifyTime;
	}

	public long getNotifyTimes() {
		return NotifyTimes;
	}

	public void setNotifyTimes(long notifyTimes) {
		NotifyTimes = notifyTimes;
	}

	public List<Msg> getMsgs() {
		return Msgs;
	}

	public void setMsgs(List<Msg> msgs) {
		Msgs = msgs;
	}
	
}
